package eval.vm;

import java.util.List;

/**
 * Interface for the main operations offered by the VM manager
 * 
 * @author Nicolo' M. Calcavecchia <calcavecchia@elet.polimi.it>
 * @author Amit Peled   <amit.kapina@gmail.com>
 * @author Igal Kaufman <igal.kaufman@gmail.com>
 * */
public interface IVMManager {

	/**
	 * Returns the total number of known VMs.
	 * 
	 * @return total number of known VMs
	 */
	public int getNumberOfVMs();

	/**
	 * Returns the configuration for the given VM number.
	 * 
	 * @param vmIdentifier VM id
	 * @return configuration for the given VM
	 */
	public VMConfiguration getVMConfiguration(VMIdentifier vmIdentifier);

	/**
	 * Returns the VMConfiguration of the given type.
	 *  
	 * @param configurationEnum VM type
	 * @return VMConfiguration of the given type.
	 */
	public VMConfiguration getVMConfigurationForEnum(
			VMConfigurationEnum configurationEnum);

	/**
	 * set Satisfied Load (MEM +CPU)
	 * @param vm
	 * @param satisfiedCpu
	 * @param satisfiedMem
	 */
	public void setSatisfiedLoad(VirtualMachine vm,int satisfiedCpu, int satisfiedMem);

	/**
	 * generate VM According To Distribution
	 * 
	 * @return the type of new VM
	 */
	public VMConfigurationEnum generateNewVmAccordingToDistribution();


	/**
	 * Adds the list of known VMs
	 * 
	 * @param vMs Vms
	 */
	public void addKnownVMs(List<VirtualMachine> vMs);

	/**
	 * Adds the VM to the list of known VMs
	 * 
	 * @param virtualMachine VM
	 */
	public void addKnownVM(VirtualMachine virtualMachine);

	/***
	 * Returns all the instantiated virtual machines
	 * 
	 * @return  VMs
	 */
	public List<VirtualMachine> getAllVirtualMachines();

	/**
	 * remove VMs from manager
	 * 
	 * @param vmsToRemove VMs
	 */
	public void removeListOfVMs(List<VirtualMachine> vmsToRemove);

	/**
	 *  get VM by ID
	 * 
	 * @param vmID
	 * @return VM
	 */
	public VirtualMachine getVMbyID(VMIdentifier vmID);

	/**
	 * get VM by ID
	 * 
	 * @param id VM id
	 * @return VM
	 */
	public VMIdentifier getVMbyID(int id);


}
